package com.yra.controller.manager;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: yrq
 * @Date: Create in 15:07 2019/11/27
 */
@Controller
@RequestMapping("/manager")
public class GoManagerController {

    @RequestMapping(value = "{url}.html",method = RequestMethod.GET)
    public ModelAndView go(@PathVariable("url") String url){
        ModelAndView mv = new ModelAndView("/admin/"+url);
        return mv;
    }

    @RequestMapping(value = {"","index"})
    public ModelAndView goToIndex(){
        ModelAndView mv = new ModelAndView("/admin/index");
        return mv;
    }

    @RequestMapping(value = "login",method = RequestMethod.GET)
    public String goToLogin(HttpServletRequest request, HttpServletResponse response){
        Object msg = request.getAttribute("msg");
        return "/admin/login";
    }

    @RequestMapping(value = "/signout")
    public void logout(){

    }
}
